package com.wc.alorithm_luogu.P1603;

import java.util.*;

/**
 * @Author congge
 * @Date 2023/4/23 19:08
 * @description https://www.luogu.com.cn/problem/P1603
 * 斯诺登的密码
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String word = sc.nextLine().toLowerCase();

        // 把.去掉
        word = word.replace(".", "");

        String number = "one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty";

        HashMap<String, Integer> map = new HashMap<>();

        int num = 1;
        for (String numStr : number.split(" ")) {
            map.put(numStr, num++);
        }
        map.put("a", 1);
        map.put("both", 2);
        map.put("another", 1);
        map.put("first", 1);
        map.put("second", 2);
        map.put("third", 3);
        map.put("zero", 0);
        String[] words = word.split(" ");
        // 存放两位数
        ArrayList<Integer> twoBitNum = new ArrayList<>();

        for (String s : words) {
            if (map.containsKey(s)) {
                int curNum = map.get(s);
                twoBitNum.add(curNum * curNum % 100);
            }
        }
        // 数组排序
        Collections.sort(twoBitNum);

        StringBuilder ans = new StringBuilder();
        for (int curNum : twoBitNum) {
            if (curNum < 10) {
                ans.append("0");
            }
            ans.append(curNum);
        }
        // 去除开头的0
        while (ans.length() > 1 && ans.charAt(0) == '0') {
            ans.deleteCharAt(0);
        }
        // 没有数字时候要输出0
        if (ans.length() == 0) {
            System.out.println("0");
        } else
            System.out.println(ans);
    }
}
